//1.导入express
const express = require('express');
let app = express();
app.get('/users',(req,res)=>{
    // res.send('请求get成功！')
    //获取查询关键字
    let data = req.query;
    console.log(data);
    res.send(data)
});
app.post('/users',(req,res)=>{
    res.send('post请求成功！')
})


//获取动态参数
app.get('/users/:params',(req,res)=>{
    let params = req.params;
    res.send(params);
})


app.listen(8081,()=>{
    console.log('express sever is running at http://127.0.0.1:8081');
})